package com.uwo.house.dao;

import com.uwo.house.beans.PayLogEntity;
import com.uwo.house.beans.request.CustomerOrderReq;
import com.uwo.house.beans.request.MeasureOrderReq;
import com.uwo.house.beans.response.MeasureOrderResp;
import com.uwo.house.beans.response.OrderTypeResp;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface OrderMeasureDao {

    int addOrderMeasure(CustomerOrderReq customerOrderReq);

    String getDecorationById(String packageId);

    void addOrder(String orderId);

    List<MeasureOrderResp> getMeasureOrder(@Param("orderId") String orderId, @Param("orderDateFrom") Date orderDateFrom,
                                           @Param("orderDateTo") Date orderDateTo, @Param("orderSts") int orderSts);
    MeasureOrderResp getMeasureDetailsByOrderId(String orderId);

    int deleteMeasureOrder(String orderId);

    int distributeOrder(String measureStaff, String orderId);

    /**
     * 测量人员得到订单列表
     */
    List<MeasureOrderResp> getMeasureOrderTo(@Param("orderId") String orderId, @Param("orderDateFrom") Date orderDateFrom,
                                           @Param("orderDateTo") Date orderDateTo, @Param("orderSts") int orderSts);

    /**
     * 测量人员接单
     */
    int receiveOrder(@Param("orderId") String orderId, @Param("userId") String userId);

    /**
     * 测量人员测量完成后更新订单状态
     */
    int updateStatus(String orderId);

    /**
     * 添加付款日志
     *
     * @param payLogEntity
     */
    void addPayLog(PayLogEntity payLogEntity);

    /**
     * 获取用户id
     *
     * @param orderId
     * @return
     */
    String getUserIdByOrderId(String orderId);

}
